/* Must be unpaused by control software to start execution. */
set_bit(EDF_CTRLPAUSE, &ed->ed_flags);
- if (ed->eid == 0)
+ if ( d->id != IDLE_DOMAIN_ID )
{
- if ( d->id != IDLE_DOMAIN_ID )
- {
- /* Initialise the per-domain timer. */
- init_ac_timer(&d->timer);
- d->timer.cpu = ed->processor;
- d->timer.data = (unsigned long)d;
- d->timer.function = &dom_timer_fn;
- }
- else
- {
- schedule_data[ed->processor].idle = ed;
- }
+ /* Initialise the per-domain timer. */
+ init_ac_timer(&ed->timer);
+ ed->timer.cpu = ed->processor;
+ ed->timer.data = (unsigned long)ed;
+ ed->timer.function = &dom_timer_fn;
+ }
+ else
+ {
+ schedule_data[ed->processor].idle = ed;
}
SCHED_OP(add_task, ed);
void sched_rem_domain(struct domain *d)
{
- rem_ac_timer(&d->timer);
+ struct exec_domain *ed;
+
+ for_each_exec_domain(d, ed)
+ rem_ac_timer(&ed->timer);
SCHED_OP(rem_task, d);
TRACE_2D(TRC_SCHED_DOM_REM, d->id, d);
}
/* Per-domain one-shot-timer hypercall. */
long do_set_timer_op(unsigned long timeout_hi, unsigned long timeout_lo)
{
- struct domain *p = current->domain;
+ struct exec_domain *p = current;
rem_ac_timer(&p->timer);
add_ac_timer(&p->timer);
}
- TRACE_4D(TRC_SCHED_SET_TIMER, p->id, p, timeout_hi, timeout_lo);
+ TRACE_5D(TRC_SCHED_SET_TIMER, p->domain->id, p->eid, p, timeout_hi,
+ timeout_lo);
return 0;
}
/* Domain timer function, sends a virtual timer interrupt to domain */
static void dom_timer_fn(unsigned long data)
{
- struct domain *p = (struct domain *)data;
- struct exec_domain *ed = p->exec_domain[0];
+ struct exec_domain *ed = (struct exec_domain *)data;
+ struct domain *d = ed->domain;
TRACE_0D(TRC_SCHED_DOM_TIMER_FN);
- update_dom_time(p);
+ update_dom_time(d);
send_guest_virq(ed, VIRQ_TIMER);
}
struct thread_struct thread;
+ struct ac_timer timer; /* one-shot timer for timeout values */
+
s_time_t lastschd; /* time this domain was last scheduled */
s_time_t lastdeschd; /* time this domain was last descheduled */
s_time_t cpu_time; /* total CPU time received till now */
/* Scheduling. */
int shutdown_code; /* code value from OS (if DF_SHUTDOWN). */
- struct ac_timer timer; /* one-shot timer for timeout values */
void *sched_priv; /* scheduler-specific data */
struct domain *next_list, *next_hash;